package com.ziqi.hututubackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ziqi.hututubackend.model.VO.PictureVO;
import com.ziqi.hututubackend.model.dto.picture.PictureQueryRequest;
import com.ziqi.hututubackend.model.dto.picture.PictureUploadRequest;
import com.ziqi.hututubackend.model.entity.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ziqi.hututubackend.model.entity.User;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
* @author wang
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-01-11 23:39:47
*/
public interface PictureService extends IService<Picture> {


    /**
     * 上传图片方法
     * @param multipartFile
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(MultipartFile multipartFile, PictureUploadRequest pictureUploadRequest, User loginUser);

    /**
     * 查询图片请求
     * @param pictureQueryRequest
     * @return
     */
    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);


    /**
     *  分页获取图片封装类
     * @param picturePage
     * @param request
     * @return
     */
    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);


    /**
     * 获取单个图片封装方法
     * @param picture 原始图片对象
     * @param request 请求
     * @return
     */
    PictureVO getPictureVO(Picture picture, HttpServletRequest request);


    /**
     * 图片数据校验方法（更新和修改图片时判断
     * @param picture
     */
    void vaildPicture(Picture picture);

}
